package net.comm.user.db;


import java.sql.ResultSet;
import java.sql.SQLException;


import net.comm.user.bean.BaseContacts;
import net.comm.user.bean.BaseDetails;
import net.comm.user.bean.BaseUsertemp;
import net.comm.util.StringUtil;

import org.sakaiproject.db.api.SqlReader;

public class DbUsertempService implements SqlReader
{

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{
			
			int  	userID = result.getInt(1);									//	会员ID
			String  nick = StringUtil.getValue(result.getString(2));			//	用户名
			String  name = StringUtil.getValue(result.getString(3));			//	真实姓名
			String  introduction = StringUtil.getValue(result.getString(4));	//	自我评价/个性签名
			int  	picID = result.getInt(5);									//	个人照片ID
			String  sex = StringUtil.getValue(result.getString(6));				//	性别
			String  work = StringUtil.getValue(result.getString(7));				//	目前职业
			String  workSet = StringUtil.getValue(result.getString(8));			//	职业隐私保护
			String  skill = StringUtil.getValue(result.getString(9));			//	特长
			String  skillSet = StringUtil.getValue(result.getString(10));		//	特长隐私保护
			String  birthday = StringUtil.getValue(result.getString(11));		//	出生日期
			String  birthdaySet = StringUtil.getValue(result.getString(12));	//	出生日期隐私保护
			String  star = StringUtil.getValue(result.getString(13));			//	星座
			String  chzodiac = StringUtil.getValue(result.getString(14));		//	生肖
			int  nationality = result.getInt(15);								//	国籍
			int  pepole = result.getInt(16);										//	民族
			int  polity = result.getInt(17);										//	政治面貌
			String  joinWorkTime = StringUtil.getValue(result.getString(18));		//	参加工作时间
			int  home_location = result.getInt(19);			//	户口省份
			int  home_sublocation = result.getInt(20);		//	户口城市
			int  home_area = result.getInt(21);				//	户口区县
			String  home_town = StringUtil.getValue(result.getString(22));			//	户口镇（街道）
			String  home_Set = StringUtil.getValue(result.getString(23));		//	户口所在地隐私保护
			String  certtype = StringUtil.getValue(result.getString(24));			//	证件类型
			String  certno = StringUtil.getValue(result.getString(25));			//	证件号码
			String  certSet = StringUtil.getValue(result.getString(26));		//	证件隐私保护
			String  marriage = StringUtil.getValue(result.getString(27));		//	婚姻状况
			String  isArmy = StringUtil.getValue(result.getString(28));			//	服役
			int  army = result.getInt(29);					//	服役
			String  armySet = StringUtil.getValue(result.getString(30));		//	服役隐私保护
			int  education = result.getInt(31);									//	学历
			String  highSchool = StringUtil.getValue(result.getString(32));		//	毕业中学
			String  hsFinshDate = StringUtil.getValue(result.getString(33));	//	中学毕业时间
			String  college = StringUtil.getValue(result.getString(34));		//	毕业大学
			String  colFinshDate = StringUtil.getValue(result.getString(35));	//	大学毕业时间
			String  schoolSet = StringUtil.getValue(result.getString(36));		//	学校隐私保护
			
			String  interest = StringUtil.getValue(result.getString(37));		//	爱好关注
			String  interestSet = StringUtil.getValue(result.getString(38));	//	爱好隐私保护
			
			int  	work_location = result.getInt(39);	//	所在省份
			int  	work_sublocation = result.getInt(40);	//	所在城市
			int  	work_area = result.getInt(41);			//	所在区县
			int  	villageID = result.getInt(42);			//	小区
			String  building = StringUtil.getValue(result.getString(43));			//	栋
			String  houseNo = StringUtil.getValue(result.getString(44));			//	号
			String  fangchanNo = StringUtil.getValue(result.getString(45));			//	房产证号码
			String  fcNoSet = StringUtil.getValue(result.getString(46));			//	房产证号码隐私保护
			int  	fcPicID = result.getInt(47);			//	房产证照片ID
			String  fcPicIDSts = StringUtil.getValue(result.getString(48));			//	房产证照片状态
			String  inTime = StringUtil.getValue(result.getString(49));			//	入住时间
			String  inTimeSet = StringUtil.getValue(result.getString(50));			//	入住时间隐私保护
			String  famSts = StringUtil.getValue(result.getString(51));			//	家庭状况
			String  famStsSet = StringUtil.getValue(result.getString(52));			//	家庭状况隐私保护
			String  liveSts = StringUtil.getValue(result.getString(53));		//	居住状况
			String  liveStsSet = StringUtil.getValue(result.getString(54));		//	居住状况隐私保护
			
			String  offwebsite = StringUtil.getValue(result.getString(55));	//官方网址
			String  perwebsite = StringUtil.getValue(result.getString(56));	//个人网址
			String  blog = StringUtil.getValue(result.getString(57));		//个人博客
			String  mobile = StringUtil.getValue(result.getString(58));		//手机				
			String  tel = StringUtil.getValue(result.getString(59));			//商务电话
			String  famtel = StringUtil.getValue(result.getString(60));		//家庭电话
			String  fax = StringUtil.getValue(result.getString(61));			//传真号码
			String  qQ = StringUtil.getValue(result.getString(62));			//QQ
			String  msn = StringUtil.getValue(result.getString(63));			//MSN		
			String  email = StringUtil.getValue(result.getString(64));		//通讯地址
			String  addr = StringUtil.getValue(result.getString(65));		//通讯地址
			String  postcode = StringUtil.getValue(result.getString(66));	//邮编
			
			String  mtime = StringUtil.getValue(result.getString(67));			//	最后修改日期		
			String  schoolSet2 = StringUtil.getValue(result.getString(68));		//	学校隐私保护

			// create the Resource from these fields
			return new BaseUsertemp( addr,  army,  armySet,  birthday, birthdaySet,  blog,  building, certSet,
					 certno,  certtype,  chzodiac, colFinshDate,  college,  education,  email,
					 famSts,  famStsSet,  famtel,  fangchanNo, fax,  fcNoSet,  fcPicID,  fcPicIDSts,
					 highSchool,  home_Set,  home_area, home_location,  home_sublocation,  home_town,
					 houseNo,  hsFinshDate,  inTime, inTimeSet,  interest,  interestSet,
					 introduction,  isArmy,  joinWorkTime, liveSts,  liveStsSet,  marriage,  mobile,
					 msn,  mtime,  name,  nationality, nick,  offwebsite,  pepole,  perwebsite,
					 picID,  polity,  postcode,  qQ, schoolSet,  sex,  skill,  skillSet,
					 star,  tel,  userID,  villageID,  work, workSet,  work_area,  work_location,
					 work_sublocation,schoolSet2);
		}
		catch (SQLException e)
		{
			return null;
		}
		
	}
}
